// 获取品牌管理数据
import request from '@/utils/request'
// 获取品牌列表
// GET /admin/product/baseTrademark/{page}/{limit}
export const reqTradeMarkList = (page, limit) => request({
  url: `/admin/product/baseTrademark/${page}/${limit}`,
  method: 'get'
})

// 新增品牌和修改品牌
// POST /admin/product/baseTrademark/save 新增BaseTrademark
// PUT /admin/product/baseTrademark/update 修改BaseTrademark
export const reqSaveOrUpdateTrademark = (tmForm) => {
  if (tmForm.id) {
    // 修改
    return request({
      url: `/admin/product/baseTrademark/update`,
      method: 'put',
      data: tmForm
    })
  } else {
    // 新增
    return request({
      url: `/admin/product/baseTrademark/save`,
      method: 'post',
      data: tmForm
    })
  }
}

// 删除品牌 DELETE /admin/product/baseTrademark/remove/{id}
export const reqDeleteTradeMark = (id) => request({
  url: `/admin/product/baseTrademark/remove/${id}`,
  method: 'delete'
})

